package tw.BBT.BasalBodyTemperature.Components.Common;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DBhelper extends SQLiteOpenHelper {

	private Context m_context;
	private static final int DATABASE_VERSION = 3;
	private static final String DABASE_NAME = "BBTSQLite";
	private static final String BBT_CreateTable = "create table BBTData (Temperature REAL,Date,State,Statistic,CycleDay,CycleCounter);";
	private static final String DeleteBBT = "drop table if exists BBTData";

	public DBhelper(Context context) {
		// TODO Auto-generated constructor stub
		super(context, DABASE_NAME, null, DATABASE_VERSION);
		this.m_context = context;
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		// TODO Auto-generated method stub
		db.execSQL(DeleteBBT);
		db.execSQL(BBT_CreateTable);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
		db.execSQL(DeleteBBT);
		db.execSQL(BBT_CreateTable);
	}

}
